package com.mutouren.modules.datapush.base;

public enum Charset {
	UTF_8((byte)0, "utf-8"),
	GBK((byte)1, "gbk");
	
	public final byte value;
	public final String name;

	private Charset(byte value, String name) {
		this.value = value;		
		this.name = name;
	}
	
	public static Charset valueOf(byte value) {
		Charset result = null;
		
		switch(value) {
		case 0: result = UTF_8; break;
		case 1: result = GBK; break;
		}
		
		return result;
	}
	
	public static void main(String[] args) {	
		System.out.println(Charset.UTF_8.toString());
	}	
}

// 字符: 0 UTF_8 1 GBK
